package com.heyun.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.stereotype.Service;

import com.heyun.bean.HeyunRole;
import com.heyun.dao.HeyunRoleDao;
import com.heyun.service.HeyunRoleService;

@Service
public class HeyunRoleImpl  implements HeyunRoleService {
	/*public static void main(String[] args) {
	ApplicationContext context=new ClassPathXmlApplicationContext("config/spring-default.xml");
	HeyunRoleService hyrs=    (HeyunRoleService) context.getBean("heyunRoleImpl");
	   System.out.println(hyrs.getRole(1));
	}*/
     @Autowired
	 private HeyunRoleDao hyrd;
	
	@Override
	public int insertRole(HeyunRole hyr) {
		// TODO Auto-generated method stub
	   int a=hyrd.insertRole(hyr);
		return a;
	}

	@Override
	public int removeHeyunRole(int roleId) {
		// TODO Auto-generated method stub
		int a =hyrd.removeHeyunRole(roleId);
		
		return a;
	}

	@Override
	public int updateRole(HeyunRole hyr) {
		// TODO Auto-generated method stub
		int a =hyrd.updateRole(hyr);
		return a;
	}

	@Override
	public List<HeyunRole> listRole() {
		// TODO Auto-generated method stub
		List<HeyunRole>list=hyrd.listRole();
		return list;
	}

	@Override
	public HeyunRole getRole(int roleId) {
		// TODO Auto-generated method stub
		HeyunRole hyro=hyrd.getRole(roleId);
		return hyro;
	
	}

	@Override
	public List<HeyunRole> listDeptRole(int deptId) {
		// TODO Auto-generated method stub
		List<HeyunRole> roleList =  hyrd.listDeptRole(deptId);
		return roleList;
	}
	
}
